<#if sniperMenu??>
<div id="sniper_menu" class="btn-group" data-spy="affix" data-offset-top="10" style="z-index:100">
    <div class="btn-group">
        <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
            <i class="fa fa-angle-double-down"></i>
        </button>
        <ul class="dropdown-menu">
            <li><a href="javascript:;" data-value="1" data-type="select">全选</a></li>
            <li><a href="javascript:;" data-value="2" data-type="select">不选</a></li>
            <li><a href="javascript:;" data-value="3" data-type="select">反选</a></li>
        </ul>
    </div>

    <#if sniperMenu.delButton == true >
        <div class="btn-group">
            <button type="button" title="删除所选" class="btn btn-danger" data-click="on"
                    data-value="${sniperMenu.delButtonValue}" data-type="delete">
                <i class="fa fa-trash-o"></i>
            </button>
        </div>
    </#if>
<#--兼容老板，已废弃-->
    <#assign sniperMenu1=sniperMenu.params!'null'>
    <#list sniperMenu1?keys as myKey>
        <#assign oper=myKey!'null'>
        <div class="btn-group">
            <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
            ${sniperMenu.getKeyValue(oper)} <span class="caret"></span>
            </button>
            <ul class="dropdown-menu" style="max-height:300px; overflow: auto;">
                <#assign value=sniperMenu.getMapValue(oper)!'null'>
                <#list value?keys as v>
                <li><a href="javascript:;" data-value='${v}'
                       data-type='${oper}'>${sniperMenu.getMapValueString(oper,v)!''}</a>
                </#list>
            </ul>
        </div>
    </#list>

    <#if sniperMenu.selects??>
        <#list sniperMenu.selects  as s>
            <div class="btn-group">
                <button type="button" class="btn btn-warning dropdown-toggle"
                        data-toggle="dropdown">
                ${s.value} <span class="caret"></span>
                </button>
                <ul class="dropdown-menu" style="max-height:300px; overflow: auto;">
                    <#list s.values?keys as sv>
                        <li>
                            <a href="javascript:;" data-value='${sv}' data-type='${s.type}'>${s.values[sv] }</a>
                        </li>
                    </#list>
                </ul>
            </div>
        </#list>
    </#if>

    <#if sniperMenu.buttons??>
        <#list sniperMenu.buttons as b>
            <div class="btn-group">
                <button type="button" class="btn btn-${b.color }" data-single="on"
                        data-url="${b.url!'' }" data-click="on" data-value="${b.value!'' }"
                        data-type="${b.type!'' }"
                        <#if b.target??>data-toggle="modal-s" data-target="${b.target }"</#if>>
                ${b.name }
                </button>
            </div>
        </#list>
    </#if>

</div>

<!-- 调用 -->
<script type="text/javascript" src="myfiles/js/jquery.sniper.menu.js"></script>
<script type="text/javascript">

    $(function () {
        $().snipermenu({
            url: '${sniperMenu.sniperUrl!''}'
        });
    });
</script>
</#if>